%option noyywrap

%{
/*  parser.y  token */
#include "parser.hpp"
%}

NUM [1-9]+[0-9]*|0
ID [a-zA-Z_]+[a-zA-Z_0-9]*
%%
"int"       return INT;
"void"      return VOID;
"if"        return IF;
"else"      return ELSE;
"while"     return WHILE;
"return"    return RETURN;
"scanf"     return SCANF;
"printf"    return PRINTF;
"("         return LPAREN;
")"         return RPAREN;
"["         return LBRACKET;
"]"         return RBRACKET;
"{"         return LBRACE;
"}"         return RBRACE;
"+"|"-"     return ADDOP;
"*"|"/"     return MULOP;
";"         return SEMICOLON;
","         return COMMA;
"="         return ASSIGN;
{NUM}       return NUM;
{ID}        return ID;
<<EOF>>     yyterminate();
" "|\t
\n
.
%%